<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/layui/layui_2/layui/css/layui.css"
	media="all">
</head>
<body>
	<br/>
	<div id='update_dept_div'>
	  	<form class="layui-form" action="${pageContext.request.contextPath }/empAction_query" id="query_form">
	  		<div class="layui-form-item">
				<label class="layui-form-label">部门名称：</label>
				<div class="layui-input-inline">
					<select name="e_sex">
					    <option value="">--请选择--</option>
						<option value="1">男</option>
						<option value="0">女</option>
				    </select>
				</div>
				<label class="layui-form-label">员工姓名：</label>
				<div class="layui-input-inline">
					<select name="dept.p_id">
						<option value="">--请选择--</option>
						<option value="0">人事部</option>
                        <option value="1">阅读</option>
                        <option value="2">游戏</option>
                        <option value="3">音乐</option>
                        <option value="4">旅行</option>	
					</select>
				</div>
				<button class="layui-btn" id="query"><i class="layui-icon">&#xe615;</i>查询</button>
		  	</div>
	  	</form>
	</div>
	<table class="layui-table" id="emp_query_table" lay-filter="emp_query_table"></table>
	<script src="${pageContext.request.contextPath }/layui/layui_2/layui/layui.js"></script>
	<script>
		layui.use(['form','element','jquery','table','layer'], function() {
			var form = layui.form,
				element = layui.element,
				$ = layui.jquery,
				table = layui.table,
				layer = layui.layer;
			
			var cols = [ [ {
				field : 'CId',
				align : 'center',
				title : '编号',
				width : 570
			}, {
				field : 'PName',
				align : 'center',
				title : '部门名称',
				width : 570
			}, {
				align : 'center',
				title : '查询',
				width : 570,
				toolbar : '#query'
			} ] ];
			
			//方法级渲染
			table.render({
				elem : '#emp_query_table',
				url : '${pageContext.request.contextPath }/clientAction_findByPage',
				cols : cols,
				id : 'testReload',
				limit: 10,
			    limits: [10, 30, 50],
				page : true
			});
			
			$("#query").click(function(){
				$("#query_form").submit();
			})			
		})
		
	</script>
	<script type="text/html" id="query">
  		<a class="layui-btn layui-btn-mini" lay-event="edit">查询</a>
	</script>
</body>
</html>